package com.test.pudamoney.bean_pudamoney.user_info_pudamoney;

import com.test.pudamoney.util_pudamoney.StringUtil_pudamoney;
import com.google.gson.Gson;

import org.json.JSONObject;

/**
 * 用户登录信息，只在用户手动登录时获取，自动登录不获取
 */
public class LoginInfo_pudamoney {

    private static class Inner {
        private static LoginInfo_pudamoney instance = new LoginInfo_pudamoney();
    }

    private LoginInfo_pudamoney(){}

    public static LoginInfo_pudamoney getInstance(){
        return Inner.instance;
    }

    private String type,token,userId;

    public static void parse(JSONObject objJson){
        Inner.instance = new Gson().fromJson(objJson.toString(), LoginInfo_pudamoney.class);
    }

    public String getToken() {
        return StringUtil_pudamoney.getSafeString(token);
    }

    public String getUserId() {
        return StringUtil_pudamoney.getSafeString(userId);
    }

    public String getType() {
        return StringUtil_pudamoney.getSafeString(type);
    }

}
